builder-tool: Don't allow property to be both resize and shrink
authorBenjamin Otte <otte@redhat.com>
Fri, 6 Mar 2020 04:29:46 +0000 (05:29 +0100)
committerBenjamin Otte <otte@redhat.com>
Fri, 6 Mar 2020 04:44:11 +0000 (05:44 +0100)
Otherwise builder-tool crashes when you do

  <property name="shrink" name="resize">1</property>

Thanks to the static analyzer for figuring that one out.

gtk/tools/gtk-builder-tool-simplify.c

index a2b42d135b7c76fc9a1c7a75dbddac6daf9a3e05..32cda19afda00cacd610da3b135dd4a7b26bfc8e 100644 (file)
@@ -1215,7 +1215,7 @@ rewrite_paned_child (Element *element,
               if (g_str_equal (elt2->element_name, "property") &&
                   has_attribute (elt2, "name", "resize"))
                 resize = elt2;
-              if (g_str_equal (elt2->element_name, "property") &&
+              else if (g_str_equal (elt2->element_name, "property") &&
                   has_attribute (elt2, "name", "shrink"))
                 shrink = elt2;
             }